import { AxiosProgressEvent, AxiosRequestConfig } from 'axios';

import { request } from '@/utils/request/axios';

/** 下载文件 - axios */
export function downloadApi<T = any>(
  config: AxiosRequestConfig,
  onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void,
) {
  return request.downloadFile<T>({
    ...config,
    onDownloadProgress,
  });
}
